//根据权限显示tab
import getInterface from '../insterface'
export default{
	mounted(){
		this.navShow();
	},
	methods:{
		navShow(){
			let jurisdictionUrl = getInterface.getJurisdictionUrl + this.$route.query.empNo;
			this.$http.get(jurisdictionUrl,{emulateJSON:true})
			.then((response) =>{
				// console.log(response);
				let nav = document.getElementById("nav");
				let weekli = document.getElementById("weekli");
				let yearli = document.getElementById("yearli");
				var teamLi = document.getElementById('teamLi');
				if(response.data !=null){
					// console.log(response.data.isBind);
					if(response.data.isBind == false){
						weekli.style.display = 'none';
						yearli.style.display = 'none';
						nav.style.visibility = 'visible';
						this.$router.push({path:'/S_Performance-team',query:{empNo:this.$route.query.empNo}});
					}else{
						weekli.style.display = 'inline-block';
						yearli.style.display = 'inline-block';
						nav.style.visibility = 'visible';
					}
					// if(response.data.isPerm == false){
					// 	nav.style.visibility = 'visible';
					// 	teamLi.style.display = 'none';
					// }else{
					// 	nav.style.visibility = 'visible';
					// 	teamLi.style.display = 'inline-block';
					// }
					// if(response.data.isBind == false && response.data.isPerm == false){
					if(response.data.isBind == false){
						this.$router.push({path:'/noPermission'});
						nav.style.visibility = 'hidden';
					}
				}
			})
		}
	}
}